package com.supplychain.scm.core.feign.annotation;

import com.supplychain.scm.core.feign.config.GrayLoadBalanceImportSelector;
import com.supplychain.scm.core.feign.config.RequestInterceptorImportSelector;
import com.supplychain.scm.core.feign.config.SupplyFeignInterceptorRegistrar;
import com.supplychain.scm.core.feign.constant.SupplyFeignConstants;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName EnableGrayFeign
 * @Description 开启灰度版本注解
 * @createTime 10:46:00 2023/02/11
 */
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import({ SupplyFeignInterceptorRegistrar.class, GrayLoadBalanceImportSelector.class, RequestInterceptorImportSelector.class})
public @interface EnableGrayFeign {

    /**
     * 是否开启灰度版本
     * @return
     */
    boolean enableGray() default false;

    /**
     * 包扫描路径
     * @return
     */
    String[] scanePath() default {SupplyFeignConstants.DEFAULT_SCANE_PATH};
}
